define(['template','jquery'],(template) => {
	class Header {
		constructor() {
		    this.loadHTML().then(() => {
				this.getTabs()
			})
		}
		loadHTML () {
			return new Promise((resolve, reject) => {
				$('header').load('/html/modules/header.html', () => {
					resolve()
				})
			})
		}
		getTabs () {
			//从熊猫优选请求数据
			$.get('http://www.xiongmaoyouxuan.com/api/tabs', resp => {
				if (resp.code === 200) {
					let { list } = resp.data
					list = list.slice(12, 15)
					$('#tabList').html(template('tablate',{ list }))
				}
			})
		}
	}
	return new Header()
})